package com.fancy.social.controller;

import com.fancy.social.dto.LikeDTO;
import com.fancy.social.service.LikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/likes")
public class LikeController {

    @Autowired
    private LikeService likeService;

    @PostMapping
    public ResponseEntity<Void> toggleLike(@RequestHeader("X-User-Id") Long userId, @RequestBody LikeDTO likeDTO) {
        likeService.toggleLike(userId, likeDTO);
        return ResponseEntity.ok().build();
    }
}
